<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{% block title %}{% endblock %}</title>
    <link rel="stylesheet" href="../static/layui/css/layui.css">
    <link rel="stylesheet" href="../static/editor.md-master/css/editormd.css">
    {% block head %}
    {% endblock %}
</head>
<body>
<div class="layui-layout layui-layout-admin">
    <div class="layui-header layui-bg-black">
        <div class="layui-logo">
            <a href="/" style="color: #F0F0F0">在线学习网站</a>
        </div>

        <ul class="layui-nav layui-layout-left" id="yuan">
            <li class="layui-nav-item" id="study_list">
                <a>学习</a>
            </li>
        </ul>

        <ul class="layui-nav layui-layout-right">
            {% if g.user.is_active %}
            <li class="layui-nav-item">
                <a href="/">{{ g.user.user_name }}</a>
                <dl class="layui-nav-child">
                    <dd><a href="{{ url_for("views.change_password") }}">修改密码</a></dd>
                    <dd><a href="{{ url_for("views.logout") }}">退出登录</a></dd>
                    <dd><a href="{{ url_for('views.history') }}">学习历史记录</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="{{ url_for("views./") }}">返回首页</a>
            </li>
            {% else %}
            <li class="layui-nav-item">
                <a href="{{ url_for("views.login") }}">登录</a>
            </li>
            {% endif %}
        </ul>
    </div>
    {% block content %}
    {% endblock %}
</div>
</body>
<script src="../static/layui/layui.all.js" charset="UTF-8"></script>
<script>
    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r != null){
            //解决中文乱码
            return decodeURI(r[2]);
        }
        return null;
    }
</script>
{% block script %}
{% endblock %}
</html>